local player = GetMyHero()

function OnTick()
    if os.clock() - (lastRun or 0) > .25 and player:CanUseSpell(igniteSlot) == READY  then
        lastRun = os.clock()
        for i = 1, heroManager.iCount, 1 do
        local hero = heroManager:getHero(i)
        if hero and hero.team == TEAM_ENEMY and not hero.dead and player:GetDistance(hero) < 600 and hero.health < 45 + 19 * player.level then
            CastSpell( igniteSlot, hero)
        end
    end
    end
end
function OnLoad()
    --Detect slot for ignite
    if player:GetSpellData(SUMMONER_1).name == "SummonerDot" then
        igniteSlot = SUMMONER_1
    elseif player:GetSpellData(SUMMONER_2).name == "SummonerDot" then
        igniteSlot = SUMMONER_2
    else
        OnWndMsg = function() end
        OnTick = function() end
        return
    end
    PrintChat(" >> Auto Ignite script loaded!")
end
